<?
    include('../home/config.php');
    $keyword = $_POST['content'];
    //echo $keyword;
    $arr_product = getProductName($keyword,'pro_date');
?>
<table style="font-size: 14px;color: #1C3A70; border:1px solid #ccc">
        <tr>
            <th>STT</th>
            <th>Mã sản phẩm</th>
            <th>Tên sản phẩm</th>
            <th>Ảnh sản phẩm</th>
            <th>Giá tiền</th>
            <th>Thuộc loại</th>
            <th>Xuất sứ</th>
            <th>Bảo hành</th>
            <th>Mô tả ngắn gọn</th>
            <th>Mô tả chi tiết</th>
            <th>Đã bán (chiếc)</th>
            <th>Sửa</th>
            <th>Xóa</th>
        </tr>
        <?
            $count  = count($arr_product);
            $i=0;
            foreach($arr_product as $key=>$value){
                $i++;?>
                <tr>
                    <td style="text-align: center;"><?=$i?></td>
                    <td><?=$value['pro_code']?></td>
                    <td><?=$value['pro_name']?></td>
                    <td style="text-align: center;">
                     <?if($value['pro_pic'] != ''){?>
                        <?showImagePro($value['pro_pic'],$path_img_product)?>
                     <?}?>
                    </td>
                    <td><?=format_number($value['pro_price'])?> đ</td>
                    <td><?=$value['cat_name']?></td>
                    <td><?=$value['pro_origin']?></td>
                    <td><?=$value['pro_gua']?></td>
                    <td><?=$value['pro_des']?></td>
                    <td><?=$value['pro_content']?></td>
                    <td style="text-align: center;"><?=$value['pro_num_sold']?></td>
                    <td><a href="edit.php?pro_id=<?=base64_encode($value['pro_id'])?>">Sửa</a></td>
                    <td><a onclick="delProduct('<?=base64_encode($value['pro_id'])?>')">Xóa</a></td>
                </tr>
            <?}
        ?>
        </form>
        </table>